import sys

from PyQt6 import QtCore, QtGui, QtWidgets
from PyQt6.QtWidgets import QMainWindow, QApplication, QLabel
class Ui_MainWindow(QMainWindow):

    def __init__(self):
        super(Ui_MainWindow, self).__init__()
        self.setupUi(self)

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(1143, 600)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap("../images/logo.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        MainWindow.setWindowIcon(icon)
        self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        # 设置背景图片
        self.centralwidget.setStyleSheet("border-image:url('../images/main.jpg')")
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(parent=MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1143, 21))
        self.menubar.setObjectName("menubar")
        self.menu_book = QtWidgets.QMenu(parent=self.menubar)
        self.menu_book.setObjectName("menu_book")
        self.menu_type = QtWidgets.QMenu(parent=self.menubar)
        self.menu_type.setObjectName("menu_type")
        self.menu_system = QtWidgets.QMenu(parent=self.menubar)
        self.menu_system.setObjectName("menu_system")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
        self.statusbar.setObjectName("statusbar")
        # 设置状态栏内容
        myLabel = QLabel()
        myLabel.setText("当前登录用户： | 作者：小锋老师；官网：http://www.python222.com")
        self.statusbar.addWidget(myLabel)
        MainWindow.setStatusBar(self.statusbar)
        self.action_book_add = QtGui.QAction(parent=MainWindow)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap("../images/add.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_book_add.setIcon(icon1)
        self.action_book_add.setObjectName("action_book_add")
        self.action_boot_list = QtGui.QAction(parent=MainWindow)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap("../images/bookManager.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_boot_list.setIcon(icon2)
        self.action_boot_list.setObjectName("action_boot_list")
        self.action_type_add = QtGui.QAction(parent=MainWindow)
        self.action_type_add.setIcon(icon1)
        self.action_type_add.setObjectName("action_type_add")
        self.action_type_list = QtGui.QAction(parent=MainWindow)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap("../images/bookTypeManager.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_type_list.setIcon(icon3)
        self.action_type_list.setObjectName("action_type_list")
        self.action_password_update = QtGui.QAction(parent=MainWindow)
        icon4 = QtGui.QIcon()
        icon4.addPixmap(QtGui.QPixmap("../images/edit.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_password_update.setIcon(icon4)
        self.action_password_update.setObjectName("action_password_update")
        self.action_quit = QtGui.QAction(parent=MainWindow)
        icon5 = QtGui.QIcon()
        icon5.addPixmap(QtGui.QPixmap("../images/password.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_quit.setIcon(icon5)
        self.action_quit.setObjectName("action_quit")
        self.action_aout = QtGui.QAction(parent=MainWindow)
        icon6 = QtGui.QIcon()
        icon6.addPixmap(QtGui.QPixmap("../images/about.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_aout.setIcon(icon6)
        self.action_aout.setObjectName("action_aout")
        self.action_activity = QtGui.QAction(parent=MainWindow)
        icon7 = QtGui.QIcon()
        icon7.addPixmap(QtGui.QPixmap("../images/me.png"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
        self.action_activity.setIcon(icon7)
        self.action_activity.setObjectName("action_activity")
        self.menu_book.addAction(self.action_book_add)
        self.menu_book.addAction(self.action_boot_list)
        self.menu_type.addAction(self.action_type_add)
        self.menu_type.addAction(self.action_type_list)
        self.menu_system.addAction(self.action_password_update)
        self.menu_system.addAction(self.action_quit)
        self.menu_system.addAction(self.action_aout)
        self.menu_system.addAction(self.action_activity)
        self.menubar.addAction(self.menu_book.menuAction())
        self.menubar.addAction(self.menu_type.menuAction())
        self.menubar.addAction(self.menu_system.menuAction())


        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "图书管理"))
        self.menu_book.setTitle(_translate("MainWindow", "图书馆里"))
        self.menu_type.setTitle(_translate("MainWindow", "图书类别管理"))
        self.menu_system.setTitle(_translate("MainWindow", "系统设置"))
        self.action_book_add.setText(_translate("MainWindow", "图书添加"))
        self.action_boot_list.setText(_translate("MainWindow", "图书信息管理"))
        self.action_type_add.setText(_translate("MainWindow", "图书类别添加"))
        self.action_type_list.setText(_translate("MainWindow", "图书类别信息管理"))
        self.action_password_update.setText(_translate("MainWindow", "修改密码"))
        self.action_quit.setText(_translate("MainWindow", "安全退出"))
        self.action_aout.setText(_translate("MainWindow", "关于作者"))
        self.action_activity.setText(_translate("MainWindow", "锋哥招收Python学员啦"))


if __name__ == '__main__':
    app = QApplication(sys.argv)
    ui = Ui_MainWindow()
    ui.show()
    sys.exit(app.exec())
